package com.erp.controller.category;

import com.erp.bean.Category;
import com.erp.bean.User;
import com.erp.dao.CategoryDao;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author tj
 * @Date 2022-06-01 16:11:58
 */
public class ListCategoryServlet extends HttpServlet {
    CategoryDao categoryDao = new CategoryDao();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Category> list = categoryDao.list();
        req.setAttribute("list",list);
        req.getRequestDispatcher("category.jsp").forward(req,resp);
    }
}